﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Expect.Core.Test.Fixtures
{
    using System.Globalization;

    public class Price
    {
        public double Montant { get; set; }

        public string Devise { get; set; }

        public static implicit operator Price(string text)
        {
            var price = new Price();
            text = text.Trim();
            if (!string.IsNullOrEmpty(text))
            {
                var parts = text.Split(' ');
                price.Montant = Convert.ToDouble(parts[0], new CultureInfo("en-US"));
                price.Devise = parts[1];
            }
            return price;
        }

    }
}
